<?php

namespace app\models;

use app\components\behaviors\CreatorBehaviors;
use Yii;

/**
 * This is the model class for table "kd_log".
 *
 * @property integer $rz_id
 * @property string $rz_shijian
 * @property string $rz_caozuoren
 * @property string $rz_datetime
 */
class Log extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'kd_log';
    }

    public function behaviors()
    {
        return [
            [
                'class'=>CreatorBehaviors::className(),
                'fieldName'=>'rz_caozuoren',
            ],
            [
                'class' => \app\components\behaviors\DatetimeBehavior::className(),
                'updateDate' => 'rz_datetime',
            ],
            [
                'class'=>\app\components\behaviors\RecoverBehavior::className(),
            ],

        ];
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['rz_shijian'], 'required'],
            [['rz_shijian'], 'string', 'max' => 200],
            [['rz_caozuoren', 'rz_datetime'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'rz_id' => '日志ID',
            'rz_shijian' => '日志内容',
            'rz_caozuoren' => '操作人',
            'rz_datetime' => '事件时间',
        ];
    }


}
